﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMD.DataModel.Entity
{
    public class ContainerEntity : BusinessEntity
    {
        private string _containerId;  //容器标识
        private string _containerModelId;  //容器模型标识
        private string _parentId;  //父节点标识
        private string _sitecode;  //位置编码
        private string _modelType;  //模型类型
        private int _remainingCapacity;  //剩余容量
        private int _wholeCapacity; //总容量
        private string _description; //描述
        private string _rootId; //根节点容器标识

        public override void setValue(string key, Object value)
        {
            if (value is System.DBNull)
                return;
            switch (key.ToLower())
            {
                case "containerid":
                    this.Id = (string)value;
                    break;
                case "containermodelid":
                    this.ContainerModelId = (string)value;
                    break;
                case "parentid":
                    this.ParentId = (string)value;
                    break;
                case "sitecode":
                    this.SiteCode = (string)value;
                    break;
                case "modeltype":
                    this.ModelType = (string)value;
                    break;
                case "remainingcapacity":
                    this.RemainingCapacity = int.Parse(value.ToString());
                    break;
                case "wholecapacity":
                    this.WholeCapacity = int.Parse(value.ToString());
                    break;
                case "description":
                    this.Description = (string)value;
                    break;
                case "rootid":
                    this.RootId = value.ToString();
                    break;                 
            }
        }

        public String RootId
        {
            get
            {
                return _rootId;
            }
            set
            {
                _rootId = value;
                OnPropertyChanged(() => RootId);
            }
        }
        public String ContainerId
        {
            get
            {
                return _containerId;
            }
            set
            {
                _containerId = value;
                OnPropertyChanged(() => ContainerId);
            }
        }

        public string ContainerModelId
        {
            get
            {
                return _containerModelId;
            }
            set
            {
                _containerModelId = value;
                OnPropertyChanged(() => ContainerModelId);
            }
        }

        public string ParentId
        {
            get
            {
                return _parentId;
            }
            set
            {
                _parentId = value;
                OnPropertyChanged(() => ParentId);
            }
        }

        public string SiteCode
        {
            get
            {
                return _sitecode;
            }
            set
            {
                _sitecode = value;
                OnPropertyChanged(() => SiteCode);
            }
        }
        public string ModelType
        {
            get
            {
                return _modelType;
            }
            set
            {
                _modelType = value;
                OnPropertyChanged(() => ModelType);
            }
        }
        public int RemainingCapacity
        {
            get
            {
                return _remainingCapacity;
            }
            set
            {
                _remainingCapacity = value;
                OnPropertyChanged(() => RemainingCapacity);
            }
        }
        public int WholeCapacity
        {
            get
            {
                return _wholeCapacity;
            }
            set
            {
                _wholeCapacity = value;
                OnPropertyChanged(() => WholeCapacity);
            }
        }
        public string Description
        {
            get
            {
                return _description;
            }
            set
            {
                _description = value;
                OnPropertyChanged(() => Description);
            }
        }
        
        
    }
}
